﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ElectronicCommerce.Framework.Data.Configuration;

namespace ElectronicCommerce.Framework.Data.Utility
{
    /// <summary>
    /// Data Filter Helper
    /// </summary>
    public class DataFilterHelper
    {
        public static FilterHost GetCurrentFilter(object obj)
        {
            var type = obj.GetType();
            var infos = DataFilterConfigHelpr.DataFilterConfig
                .Hosts.FindAll(c => c.TypeInfo == type);
            if (infos.Count > 0)
            {
                return infos[0];
            }
            return null;
        }
    }
}
